package com.pet_service.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.pet_service.util.CodeEnum;
import lombok.Getter;

/**
 * 用户状态枚举
 */
@Getter
public enum TUserStatus implements CodeEnum {
    DISABLED(0, "禁用"),
    ACTIVE(1, "正常");

    @EnumValue//标记枚举与数据库交互时使用的值。
    private final int code;
    private final String desc;

    TUserStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    @JsonValue
    public int getCode() { return code; }
    public String getDesc() { return desc; }
}


